package com.zx.cloud.controller.client;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import com.zx.cloud.Shift;
import com.zx.cloud.controller.StatusCode;
import com.zx.cloud.domain.ClientContact;
import com.zx.cloud.domain.ClientInfo;
import com.zx.cloud.domain.Proposal;
import com.zx.cloud.model.response.ObjectDataResponse;
import com.zx.cloud.util.Page;

/**
 * @Description:
 *
 * @author       Yan Weiwei
 * @Create Time: 2017年11月1日下午1:36:39
 */
@Component
public class ClientInfoClientFallback implements ClientInfoClient {
	
	private static final Logger LOGGER = LoggerFactory.getLogger(ClientInfoClientFallback.class);
	
	private void didNotGetResponse() {
        LOGGER.error("service '{}' has become unreachable", ClientInfoClient.SERVICE_ID);
    }

	@Override
	public ObjectDataResponse<Page<Object>> queryClientInfo(ClientInfo clientInfo) {
		didNotGetResponse();
        Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
        return null;
	}

	@Override
	public ObjectDataResponse<ClientInfo> queryClientInfoById(String tableId) {
		didNotGetResponse();
        Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}

	@Override
	public ObjectDataResponse<List<ClientContact>> queryClientContact(String tableId) {
		didNotGetResponse();
        Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}

	@Override
	public ObjectDataResponse<Page<ClientInfo>> queryClientAuth(ClientInfo clientInfo) {
		didNotGetResponse();
        Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}

	@Override
	public ObjectDataResponse<Integer> updateClientInfo(ClientInfo clientInfo) {
		didNotGetResponse();
        Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}

	@Override
	public ObjectDataResponse<Integer> addClientInfo(ClientInfo clientInfo) {
		didNotGetResponse();
        Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}

	@Override
	public ObjectDataResponse<Page<Proposal>> queryProposal(Proposal proposal) {
		didNotGetResponse();
        Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
        return null;
	}

	@Override
	public ObjectDataResponse<Integer> updateProposal(Proposal proposal) {
		didNotGetResponse();
        Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
        return null;
	}

}
